package com.whu.assignment8.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.whu.assignment8.entity.Supplier;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  supplierMapper 接口
 * </p>
 *
 * @author Aohancooll
 * @since 2022-10-17
 */
@Mapper
public interface supplierMapper extends BaseMapper<Supplier> {

    @Select("select * from supplier s" +
            " inner join product_suppliers ps on s.id=ps.suppliers_id" +
            " where ps.product_id = #{productIds}")
    public List<Supplier> findSuppliersByProduct(String productId);
}
